﻿using System.Collections.Generic;
using _2DGame_Preview_Server.Services.RoomAndBattle.Room.Modle;
using Newtonsoft.Json;
using Script.UiSystem.Room;
using SimpleTools.Json;
using UnityEngine;

namespace Script.NetSystem.Services.RoomAndBattle.RoomService.Handler
{
    public class RoomRoles : IRoomHandler
    {
        public void Handler(RoomController controller, JsonData jsonData)
        {
            List<PlayerInfo_Room> players =
                JsonConvert.DeserializeObject<List<PlayerInfo_Room>>(jsonData.GetStr("roles"));

            controller.RoomView.LoadPlayerCard(players);
            
        }
    }
}